<crm-main-nav  nav-c="notice" page-title="待办事项"></crm-main-nav>
<!-- 面包屑 -->
<div class="container">
  <ol class="breadcrumb">
    <li>CRM系统</li>
    <li class="active">待办事项</li>
  </ol>
</div>
<!-- 内容 -->
<crm-panel title="事项筛选">
	<div ng-controller="noticeIndexController">
		<form class="form row form-horizontal" role="form" method="post" ng-submit="noticeForm()">
			<div class="form-group col-sm-4">
				<label class="control-label col-sm-3">事项类型：</label>
				<div class="col-sm-9 input-wrap">
					<select class="form-control" name="type" ng-model="formData.type">
						<option value="">--请选择--</option>
						<option value="沟通提醒" >--沟通提醒--</option>
						<option value="其他提醒" >--其他提醒--</option>
					</select>
				</div>
			</div>
			<div class="form-group col-sm-4">
				<label class="control-label col-sm-3">是否提醒：</label>
				<div class="col-sm-9 input-wrap">
					<select class="form-control" name="remind" ng-model="formData.remind">
						<option value="">--请选择--</option>
						<option value="1">是</option>
						<option value="0">否</option>
					</select>
				</div>
			</div>		
			<div class="form-group col-sm-4">
				<label class="control-label col-sm-3">状态：</label>
				<div class="col-sm-9 input-wrap">
					<select class="form-control" name="state" ng-model="formData.state">
						<option value="">--请选择--</option>
						<option value="1">完成</option>
						<option value="0">未完成</option>
					</select>
				</div>
			</div>
			<div class="submit-box">
				<input type="submit" class="btn btn-primary" value="开始筛选"/>
			</div>
		</form>
		<table class="table table-bordered" style="margin-top:12px;" ng-show="noticeData.length>0">
	        <thead>
				<tr>
					<th>事项类型</th>
					<th>提醒日期</th>
					<th>商机ID</th>
					<th>备注</th>
					<th>创建时间</th>
					<th>提醒</th>
					<th>状态</th>
					<th>操作</th>
				</tr>
	        </thead>
	        <tbody>
				<tr ng-repeat="(k,v) in noticeData track by $index">
					<td>{{v.type}}</td>
					<td>{{v.reminder_date | date:'yyyy-MM-dd HH:mm'}}</td>
					<td><a href="#/Main/main_khxxy/{{v.business_id}}">{{v.business_id}}</a></td>
					<td>{{v.remark | overflowEllipsisFilter:9}}</td>
					<td>{{v.time | date:'yyyy-MM-dd HH:mm'}}</td>
					<td>{{v.remind=="1"?"是":"否"}}</td>
					<td>{{v.state=="1"?"完成":"未完成"}}</td>
					<td>
						<button type="button" class="btn btn-default btn-sm" ng-click="edit_notice(v)">修改</button>
						<button type="button" class="btn btn-default btn-sm" ng-click="del_notice(v)">删除</button>
					</td>
				</tr>
	        </tbody>
	    </table>
	    <!-- 操作模态框 -->
		<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		  <div class="modal-dialog">
		    <div class="modal-content">
		      <div class="modal-header">
		        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
		        <h4 class="modal-title" id="myModalLabel">修改事项</h4>
		      </div>
		      <div class="modal-body">
		        <form class="form-horizontal" role="form"  ng-submit="editNoticeForm()" id="edit_notice_form">
		          <div class="form-group">
		            <label class="col-sm-2 control-label">事项类型：</label>
		            <div class="col-sm-3">
		              <select name="type" class="form-control" ng-model="editData.type">
		                <option value="沟通提醒">--沟通提醒--</option>
		                <option value="其他提醒">--其他提醒--</option>
		              </select>
		            </div>
		          </div>
		          <div class="form-group">
		            <label class="col-sm-2 control-label">提醒日期：</label>
		            <div class="col-sm-4">
		              <date-input  get-date="editData.reminder_date" style-date="YYYY-MM-DD HH-mm"></date-input>
	              	</div>
		          </div>
		          <div class="form-group">
		            <label class="col-sm-2 control-label">备注内容：</label>
		            <div class="col-sm-4">
		              <input type="text" name="remark" class="form-control" ng-model="editData.remark">
		            </div>
		          </div>
		          <div class="form-group">
		            <label class="col-sm-2 control-label">是否提醒：</label>
		            <div class="col-sm-4">
		              <label class="control-label"><input type="radio" name="remind" ng-model="editData.remind" value="1" ng-checked="editData.remind==1">是</label>
		              <label class="control-label"><input type="radio" name="remind" ng-model="editData.remind"  value="0" ng-checked="editData.remind==0">否</label>
		            </div>
		          </div>
		          <div class="form-group">
		            <label class="col-sm-2 control-label">状态：</label>
		            <div class="col-sm-4">
		              <label class="control-label"><input type="radio" ng-model="editData.state" ng-checked="editData.state==1" name="state" value="1">完成</label>
		              <label class="control-label"><input type="radio" ng-model="editData.state" ng-checked="editData.state==0" name="state" value="0">未完成</label>
		            </div>
		          </div>
		        </form>
		      </div>
		      <div class="modal-footer">
		        <button type="button" class="btn btn-primary" ng-click="editNoticeForm()">确定</button>
		        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
		      </div>
		    </div>
		  </div>
		</div>
    </div>
</crm-panel>